<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:74:"D:\phpStudy\WWW\tjsgkj\public/../application/admin\view\project\index.html";i:1507734904;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://cdn.bootcss.com/wangeditor/2.1.20/js/lib/jquery-2.2.1.js"></script>
    <script src="//unpkg.com/wangeditor@3.0.10/release/wangEditor.min.js"></script>
    <link href="//unpkg.com/wangeditor@3.0.10/release/wangEditor.min.css" rel="stylesheet">
</head>
<body>

<!--编辑器位置-->
<div style="max-width:700px;margin:50px">

    <form action="index.html" id="project">
        标题<input type="text" name="title" value="{$pro.title}" >
        <div id="txtdiv" style="border:1px solid gray;min-height:240px">
        </div>
        <input type="button"  value="submit"  onclick="onSubmit()">
    </form>

</div>



<!--脚本控制-->
<script>
    var E = window.wangEditor;
    var editor = new E('#txtdiv');
    // 下面两个配置，使用其中一个即可显示“上传图片”的tab。但是两者不要同时使用！！！
    editor.customConfig.uploadImgShowBase64 = true;   // 使用 base64 保存图片
    //editor.customConfig.uploadImgServer = '/upload'; // 上传图片到服务器
    editor.create();

    editor.txt.text({$pro.textbox});

    $(function(){

    });
    function  onSubmit () {
        //alert(editor.txt.text());
        $.ajax({
            type: "POST",
            dataType: "html",
            url: "add",
            data:   $('#project').serialize() + "&textbox=" + editor.txt.text() ,
            success: function (result) {
                alert(strresult);
            },
            error: function(data) {
                alert("error:"+data.responseText);
            }
        });
    }

</script>

</body>
</html>